/**
 * @param {Array<string>} roles 有权访问的角色
 * @param {Array<string>} userRoles 当前用户的角色
 * @returns boolean
 */

export const hasAuth = (roles: Array<string>, userRoles: Array<string> | undefined) => {
    if (!userRoles) return []

    return userRoles.some(role => roles.includes(role))
}